package org.aphelie.torg.ruler.internal.core.text.character;

import org.aphelie.torg.ruler.core.character.ICharacter;
import org.eclipse.core.runtime.CoreException;


public class CharacterNode extends CharacterBaseNode implements ICharacter {

    private static final long serialVersionUID = 1L;

    /* (non-Javadoc)
     * @see org.eclipse.pde.core.plugin.ICharacter#getClassName()
     */
    public String getClassName() {
        return getXMLAttributeValue(P_CLASS_NAME);
    }

    /* (non-Javadoc)
     * @see org.eclipse.pde.core.plugin.ICharacter#setClassName(java.lang.String)
     */
    public void setClassName(String className) throws CoreException {
        setXMLAttribute(P_CLASS_NAME, className);
    }

    /* (non-Javadoc)
     * @see org.eclipse.pde.internal.ui.model.plugin.CharacterBaseNode#getSpecificAttributes()
     */
    protected String[] getSpecificAttributes() {
        String classname = getClassName();
        if (classname != null && classname.trim().length() > 0)
            return new String[] {"   " + P_CLASS_NAME + "=\"" + classname + "\""}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        return new String[0];
    }

    public boolean hasExtensibleAPI() {
        return false;
    }

}
